package org.umlviewer.model;

import java.awt.Graphics;
import java.awt.Rectangle;

/**
 *
 * @author Rafa
 */
public abstract class DrawElement extends UMLElement implements Cloneable {

    //elemento seleccionado
    private boolean bselected = false;
    //si se deben recalcular las dimensiones del elemento
    private boolean needrefresh=true;   
             
    public boolean isSelected() {
        return bselected;
    }

    public void setSelected(boolean selected) {
        this.bselected = selected;
    }

    public boolean Needrefresh() {
        return needrefresh;
    }

    public void setRefresh(boolean needrefresh) {
        this.needrefresh = needrefresh;
    }    
    
    public abstract boolean contains(int x, int y);    
    
    public abstract void paint(Graphics g);
    
    public abstract Rectangle getBounds();
    
    public abstract void resize(Rectangle r);
                          
    public abstract void move(int x, int y);
    
    /*TODO: copy / paste si se va a implementar buscar otra forma para no sobrescribir
        el metodo clone en cada clase hija
    */    
    public Object clone() {
        Object clon = null;
        try {
            clon = super.clone();
        } catch (CloneNotSupportedException e) {
            System.out.println("No se pudo clonar");
        }
        return clon;
    }

}
